#ifndef OHLC_H
#define OHLC_H

#include <QString>

class OHLCVItem
{
public:
    OHLCVItem(QString *stockName, double open, double high, double low, double close, double volume, uint unixdate);
    OHLCVItem(): open(0.0), high(0.0), low(0.0), close(0.0), volume(0.0)
    {
        this->unixdate = 0;
        this->stockName = QString();
    }

    //ordena pelo nome e depois pela data. coisa linda.
    bool operator<(OHLCVItem const & other) const
    {
        if (this->stockName.toLower() == other.stockName.toLower()){
            return this->unixdate < other.unixdate;
        }
        else{
            return this->stockName.toLower() < other.stockName.toLower();
        }
    }


    double open, high, low, close, volume;
    long unixdate; //unix date
    QString stockName;


};



#endif // OHLC_H
